<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('会议报名')"/>
    <th:block th:include="include :: jasny-bootstrap-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-signUp-add">
        <input name="addresseeId" th:field="${addressee.addresseeId}" type="hidden">
        <input name="noticeId" th:field="${addressee.noticeId}" type="hidden">
        <input name="addresseeName" th:field="${addressee.addresseeName}" type="hidden">
        <input name="addresseeRead" th:field="${addressee.addresseeRead}" type="hidden">
        <input name="readTime" th:field="${addressee.readTime}" type="hidden">
        <div class="form-group col-sm-12">
            <label class="col-sm-3 control-label is-required">参会人员</label>
        </div>
        <div class="form-group col-sm-12">
            <div class="col-sm-8">
                <textarea name="participantsName" class="form-control" rows="4" type="text"
                          th:field="*{addressee.participantsName}" placeholder="请输入姓名"></textarea>
            </div>
        </div>
        <div class="form-group col-sm-12">
            <label class="col-sm-3 control-label">格式：XXX,XXX,XXX（英文逗号分隔）</label>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: jasny-bootstrap-js"/>
<script type="text/javascript">
    var prefix =  ctx + "education/notice";
    $("#form-signUp-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            save(prefix + "/signUp", $('#form-signUp-add').serialize(), function (res) {
                if (res.success) {
                    $.modal.close();
                }
            });
        }
    }

    function save(url, data, callback) {
        var config = {
            url: url,
            type: "post",
            dataType: "json",
            data: data,
            beforeSend: function (request) {
                request.setRequestHeader("X-Access-Token", storage.get("token"));
            },
            success: function (result) {
                $.operate.saveSuccess(result);
            }
        };
        $.ajax(config)
    }
</script>
</body>
</html>
